using Microsoft.EntityFrameworkCore;
using UniversalAdminSystem.Domian.Core.ValueObjects;
using UniversalAdminSystem.Domian.UserManagement.Entities;
using UniversalAdminSystem.Domian.UserManagement.IRepository;
using UniversalAdminSystem.Infrastructure.Persistence.DbContexts;

namespace UniversalAdminSystem.Infrastructure.Persistence.Repositories;

public class UserInfoRepository : BaseRepository<UserInfo>, IUserInfoRepository
{
    public UserInfoRepository(UniversalAdminSystemDbContext dbContext) : base(dbContext)
    {
    }

        public override async Task<UserInfo?> GetByGuidAsync(Guid id)
        {
            var userInfoId = UserInfoId.Create(id);
            var userInfo =await _TDs.FirstOrDefaultAsync(f => f.UserInfoId == userInfoId);
            return userInfo;
        }
}